package stu.day9_day18;

import java.util.ArrayList;

public class LeetCode303 {

    private ArrayList<Integer> list = new ArrayList<>();
    public LeetCode303 (int[] nums) {
        for(int i:nums){
            list.add(i);
        }
    }

    public int sumRange(int left, int right) {
        int num = 0;
        for(int i=left;i<=right;i++){
            num += list.get(i);
        }
        return num;

    }
}
